package cn.fresh.xuanyuan.module.infra.controller.app.plate;

import cn.fresh.xuanyuan.framework.common.pojo.CommonResult;
import cn.fresh.xuanyuan.module.infra.service.column.MallColumnService;
import cn.fresh.xuanyuan.module.infra.vo.MallColumnVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 微信端首页接口
 */
@RestController
@RequestMapping(value = "/infra/wxIndex")
@Tag(name = "用户 微信端 - 首页数据")
@Slf4j
public class WxIndexController {

    @Resource
    private MallColumnService mallColumnService;

    @GetMapping(value = "/home")
    @Operation(summary = "首页栏目数据")
    public CommonResult<List<MallColumnVo>> home() {
        List<MallColumnVo> list = mallColumnService.wxIndex();
        return CommonResult.success(list);
    }
}
